Field of the Invention
The present invention generally relates to physical simulations and, more specifically, to a technique for simulating the dynamics of hair.
Description of the Related Art
Conventional simulation engines are capable of simulating the dynamics of of a wide variety of physical objects, including polygons, particles, and hair. In order to simulate the dynamics of hair, a conventional simulation engine typically models each strand of hair as a chain of particles. The simulation engine may apply a physics-based algorithm to each particle in a chain of particles in order to update the position of each such particle at a given time step in the simulation. The physics-based algorithm may incorporate various laws of motion, as well as different physical constraints, when updating the positions of particles in the chain of particles.
When simulating hair via the approach described above, the simulation engine typically imposes a distance constraint between particles in the chain of particles in order to ensure that neighboring particles reside a fixed distance from one another. Enforcing distance constraints in this fashion may cause the chain of particles to appear inextensible and therefore more similar to a natural strand of hair.
However, enforcing multiple different sets of constraints can be difficult because updating the position of one particle to meet one set of constraints may end up causing the position of that particle to violate a different set of constraints. Conventional simulation engines work around this problem by iteratively adjusting the position of each particle many times during a given time step until all constraints are met.
The problem with this approach is that applying a physics-based algorithm and associated physical constraints iteratively at every time step of the simulation for every particle in the simulation in order to prevent the hair from appearing stretchy is often computationally intensive, and may result in a very slow physics simulation. Reducing the number of iterations per time step can speed up the simulation but this results in unrealistic looking stretchy hair. Consequently, the simulation of inextensible hair could not be implemented within a real-time physics simulation such as a video game.
Accordingly, what is needed in the art is a more efficient technique for simulating hair in real-time.